#!/bin/bash

cat /etc/sysconfig/selinux |grep SELINUX=disabled > /dev/null
if [ $? -ne 0 ];then
setenforce 0 && sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
fi

Cur_Dir=`pwd`
unzip -o libfastcommon-master.zip
cd libfastcommon-master
chmod 744 *
./make.sh
./make.sh install
export LD_LIBRARY_PATH=/usr/lib64/
ln -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so 
ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so
ln -s /usr/lib64/libfdfsclient.so /usr/local/lib/libfdfsclient.so
ln -s /usr/lib64/libfdfsclient.so /usr/lib/libfdfsclient.so

cd $Cur_Dir
unzip -o fastdfs-master.zip
cd fastdfs-master
chmod 744 *
./make.sh
./make.sh install
\cp conf/http.conf /etc/fdfs
\cp conf/mime.types /etc/fdfs
